﻿using System;
using System.Collections.Generic;

    class Program
    {
        static int Min(int[] arr)
        {
            int length = arr.Length;
            int min = int.MaxValue;
            for (int i = 0; i < length; i++)
            {
                if (arr[i] < min)
                {
                    min = arr[i];
                }
            }
            return min;
        }
        static int Max(int[] arr)
        {
            int length = arr.Length;
            int max = 0;
            for (int i = 0; i < length; i++)
            {
                if (arr[i] > max)
                {
                    max = arr[i];
                }
            }
            return max;
        }
        static int Average(int[] arr)
        {
            int length = arr.Length;
            int sum = 0;
            int result = 0;
            for (int i = 0; i < length; i++)
            {
                sum = sum + arr[i];
                result = sum / length;
            }
            return result;
        }
        static int Sum(int[] arr)
        {
            int length = arr.Length;
            int sum = 0;
            for (int i = 0; i < length; i++)
            {
                sum = sum + arr[i];
            }
            return sum;
        }
        static int Product(int[] arr)
        {
            int length = arr.Length;
            int product=1;
            for (int i = 0; i < length; i++)
            {
                product = product * arr[i];
            }
            return product;
        }
        static void Main(string[] args)
        {
            Console.Write("Enter n for length of the array: ");
            int n = int.Parse(Console.ReadLine());
            int[] arr=new int[n];
            for (int i = 0; i < arr.Length; i++)
            {
                arr[i] = int.Parse(Console.ReadLine());
            }
            int min=Min(arr);
            Console.WriteLine("The min is {0} ",min);
            int max = Max(arr);
            Console.WriteLine("The max is {0} ", max);
            int average=Average(arr);
            Console.WriteLine("The average is {0} ", average);
            int sum=Sum(arr);
            Console.WriteLine("The sum is {0} ", sum);
            int product=Product(arr);
            Console.WriteLine("The product is {0} ", product);
        }
    }

